namespace mplat{
    export class XmSystem extends BaseSystem{
        getSystemInfoSync(): _getSystemInfoSyncReturnValue {
            return qg.getSystemInfoSync();
        }
        getLaunchOptionsSync(): any {
            return qg.getLaunchOptionsSync();
        }

        loadSubpackage(name: string, success: () => void, progress: (res: any) => void, fail?: () => void): void {
            if (!qg['loadSubpackage']) {
                super.loadSubpackage(name, success, progress, fail);
                return;
            }
            if (!name) {
                if (!!success) success();
                return;
            }
            qg['loadSubpackage']({
                name: name,
                success: success,
                fail: fail
            }).onProgressUpdate(res => {
                if (!!progress) progress(res);
            });
        }
        /** 是否长屏手机 */
        isLongPhone() {
            let info = getSystemInfoSync();
            if (info && info.windowHeight && info.windowWidth) {
                return info.windowHeight / info.windowWidth > 1.85
            }
            return false;
        }

        onIOS() {
            return false;
        }

        onAdr() {
            return true;
        }
    }
}